﻿<Window x:Class="STOCK.FormulaUI"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="FormulaUI" Height="800" Width="1000" ResizeMode="NoResize" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen">
    <Grid>
        <DockPanel>
            <ToolBar DockPanel.Dock="Top" Height="30">
                <Button Name="btnInsert" Content="插入|" Click="btnInsert_Click"></Button>
                <Button Name="btnEdit" Content="编辑|" Click="btnEdit_Click"></Button>
                <Button Name="btnView" Content="查看|" Click="btnView_Click"></Button>
                <Button Name="btnDelete" Content="删除" Click="btnDelete_Click"></Button>
            </ToolBar>
            <GroupBox Height="80" DockPanel.Dock="Top" Header="搜索条件">
                <Grid>
                    <ComboBox Height="23" SelectedValuePath="Id" DisplayMemberPath="Name" HorizontalAlignment="Left" Margin="80,6,0,0" Name="cmbCat" VerticalAlignment="Top" Width="120" />
                    <Button Content="搜索" Height="23" HorizontalAlignment="Left" Margin="266,6,0,0" Name="btnSearch" VerticalAlignment="Top" Width="75" Click="btnSearch_Click" />
                    <CheckBox Content="分类" Height="16" HorizontalAlignment="Left" Margin="15,10,0,0" Name="cbCatId" VerticalAlignment="Top" />
                    <Button Content="显示全部" Height="23" HorizontalAlignment="Left" Margin="402,6,0,0" Name="btnListAll" VerticalAlignment="Top" Width="75" Click="btnListAll_Click" />
                </Grid>
            </GroupBox>
            <DataGrid Name="datagrid" DockPanel.Dock="Top" IsReadOnly="True" AutoGenerateColumns="False" MouseDoubleClick="datagrid_MouseDoubleClick">
                <DataGrid.Columns >
                    <DataGridTextColumn  Header="名称" Binding="{Binding Name}" Width="100"></DataGridTextColumn>
                    <DataGridComboBoxColumn x:Name="colCat" SelectedValueBinding="{Binding CatId}" Header="分类" Width="100" SelectedValuePath="Id" DisplayMemberPath="Name"></DataGridComboBoxColumn>
                    <DataGridTextColumn  Header="公式" Binding="{Binding Formula}" Width="350"></DataGridTextColumn>
                    <DataGridTextColumn Header="描述" Binding="{Binding Discription}" Width="400"></DataGridTextColumn>
                </DataGrid.Columns>
            </DataGrid>
        </DockPanel>
        
    </Grid>
</Window>
